package com.sq.partner.manager.dao;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import com.sq.partner.manager.mybatis.model.GatewayPolicy;
import com.sq.partner.manager.util.Page;


/**
 * 保单查询
 * @author Kang
 *
 */
public interface IGatewayPolicyDao extends BaseDao{

	/**
	 * 分页条件查询人险保单信息
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public Page queryLifePolicyPageByCriteria(Page page) throws Exception;
	
	/**
	 * 条件查询人险保单信息
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public List<Map<String,Object>> queryLifePolicyListByCriteria(Map<String,Object> map) throws Exception;
	/**
	 * 条件查询扫码保单信息
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public List<Map<String,Object>> queryScanPolicyListByCriteria(Map<String,Object> map) throws Exception;
	
	public GatewayPolicy queryPolicyInfoByPolNo(String polNo) throws Exception;

	/**
	 * 分页条件查询财险保单信息
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public Page queryNocarPolicyPageByCriteria(Page page) throws Exception;


	/**
	 * 分页条件查询燃气险保单信息
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public Page queryFuelGasPolicyPageByCriteria(Page page) throws Exception;

	/**
	 * 分页条件查询车险保单信息
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public Page queryCarPolicyPageByCriteria(Page page) throws Exception;
	/**
	 * 条件查询财险保单信息
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public List<Map<String,Object>> queryNocarPolicyListByCriteria(Map<String,Object> map) throws Exception;
	/**
	 * 条件查询燃气险保单信息
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public List<Map<String,Object>> queryFuelGasPolicyListByCriteria(Map<String,Object> map) throws Exception;
	/**
	 * 条件查询车险保单信息
	 * @param page
	 * @return
	 * @throws Exception
	 */
	public List<Map<String,Object>> queryCarPolicyListByCriteria(Map<String,Object> map) throws Exception;

	/***
	 * 根据保单号查询保单信息
	 */
	public GatewayPolicy queryNocarPolicyInfoByPolNo(String polNo) throws Exception;

	public Page queryLifePolicyEinvoiceInfoByPage(Page page) throws SQLException;

	List<Map<String, Object>> queryLifePolicyEinvoiceListByCriteria(
			Map<String, Object> map) throws Exception;
	/**
	 * 展示汇总
	 * @param map
	 * @return
	 * @throws Exception
	 */
    List<Map<String, String>> queryLifePolicyAll(Map<String, String> map) throws Exception;
    public Map<String, Object> queryNocarPolicyAll(Map<String, String> map)throws Exception;

	/**
	 * 燃气险展示汇总
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public Map<String, Object> queryFuelGasPolicyAll(Map<String, String> map)throws Exception;
    /**
     * 查询界面出单导出数据
     * @param map
     * @return
     * @throws Exception
     */
    List<Map<String, Object>> queryLifeFacadePolicyListByCriteria(Map<String, Object> map) throws Exception;

	Page queryScanPolicyPageByCriteria(Page page) throws Exception;

	Map<String, String> queryScanPolicyAll(Map<String, String> map)
			throws Exception;

	GatewayPolicy queryScanPolicyInfoByPolNo(String polNo) throws Exception;
	
	/**
	 * 根据保单号查询保单信息
	 * @param polNo
	 * @return
	 * @throws Exception
	 */
	GatewayPolicy queryGatewayPolicyByPolno(String polNo) throws Exception;
	
	Map<String,String> queryOFDAndProofDownloadUrl(String policyId) throws Exception;
	
	
	/**
	 * @since	2022年4月8日
	 * @see	单条批单查询（最新的）
	 * 		SELECT * from 
       			(SELECT ROWNUM r , e.* from t_gateway_endorse e WHERE e.policy_no ORDER BY e.valid_date DESC ) temp
    		WHERE r = 1
	 * @param polno
	 * @return
	 * @throws Exception
	 */
	public String querySingleEndorseByPolno(String polno) throws Exception;

}
